home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Windows / WindowInitializer.h < prev    next >
Text File  |  2000-06-23  |  2KB  |  71 lines

  1. // WindowInitializer.h
  2.  
  3. #ifndef WindowInitializer_h
  4. #define WindowInitializer_h
  5.  
  6. #ifndef Rectangle_h
  7. #include "Rectangle.h"
  8. #endif
  9. #ifndef Str_h
  10. #include "Str.h"
  11. #endif
  12.  
  13. #include <QuickDraw.h>
  14.  
  15. class WindowDefinition;
  16. class WindowDefaults;
  17.  
  18. class WindowInitializer
  19.   {
  20.     private:
  21.         bool useDefaultScreen;
  22.         GDHandle screen;
  23.         
  24.         bool useDefaultPosition;
  25.         Rectangle position;
  26.         
  27.         bool useDefaultName;
  28.         mutable String255 name;
  29.  
  30.         bool useDefaultIndex;
  31.         uint32 index;
  32.         
  33.         bool useDefaultVisibility;
  34.         bool visible;
  35.         
  36.         bool zoomOpen;
  37.         Rectangle zoomSource;
  38.     
  39.     public:
  40.         WindowInitializer();
  41.  
  42.         void SetScreen( GDHandle s )                    { screen = s; useDefaultScreen = false; }
  43.         void UseDefaultScreen()                            { useDefaultScreen = true; }
  44.         GDHandle ScreenFor( const WindowDefaults& ) const;
  45.         
  46.         void SetPosition( const Rectangle& r )        { position = r; useDefaultPosition = false; }
  47.         void UseDefaultPosition()                        { useDefaultPosition = true; }
  48.         Rectangle PositionFor( const WindowDefaults& ) const;
  49.  
  50.         void SetName( ConstPString n )                { name = n; useDefaultName = false; }
  51.         void UseDefaultName()                            { useDefaultName = true; }
  52.         ConstPString NameFor( const WindowDefaults& ) const;
  53.  
  54.         void SetIndex( uint32 i )                        { index = i; useDefaultIndex = false; }
  55.         void UseDefaultIndex()                            { useDefaultIndex = true; }
  56.         uint32 IndexFor( const WindowDefaults& ) const;
  57.  
  58.         void BeVisible()                                    { visible = true; useDefaultVisibility = false; }
  59.         void BeHidden()                                    { visible = false; useDefaultVisibility = false; }
  60.         void SetVisibility( bool v )                    { visible = v; useDefaultVisibility = false; }
  61.         void UseDefaultVisibility()                    { useDefaultVisibility = true; }
  62.         bool VisibilityFor( const WindowDefaults& ) const;
  63.         
  64.         void ZoomFrom( const Rectangle& source )    { zoomOpen = true; zoomSource = source; }
  65.         void DontZoom()                                    { zoomOpen = false; }
  66.         bool ZoomOpen() const                            { return zoomOpen; }
  67.         const Rectangle& ZoomSource() const            { Assert( zoomOpen ); return zoomSource; }
  68.   };
  69.  
  70. #endif
  71.